package com.school.service;

import com.school.dao.UsersDAO;
import com.school.entity.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UsersService {
    @Autowired
    private UsersDAO dao;

    @Override
    public String toString() {
        return "UsersService{" +
                "dao=" + dao +
                '}';
    }

    public UsersService() {
        System.out.println("UserService创建！");
    }

    public Users selectOne(Users users) {
        return dao.selectOne(users);
    }

    public int insertOne(Users users) {
        int i = 0;
        try {
            i = dao.insertOne(users);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return i;
    }

}
